package jgl.vajra.kingkong.part.vehicle.viewModel;

import java.util.Map;

import jgl.vajra.kingkong.part.vehicle.contract.ChangeDriverContract;
import jgl.vajra.kingkong.part.vehicle.model.ChangeDriverModel;
import jgl.vajra.kingkong.widget.mvvm.factory.CreateModel;
import jgl.vajra.kingkong.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(ChangeDriverModel.class)
public class ChangeDriverViewModel extends ChangeDriverContract.ViewModel{
    @Override
    public void cancelOrder(Map<String, Object> map) {
        mModel.cancelOrder(map).subscribe(new ProgressObserver<String>(true, this) {
            @Override
            public void _onNext(String s) {
                mView.returnCancelOrder();
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }
}
